<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>{$site_name}</title>
<!-- CSS -->
<link rel="stylesheet" href="{url:#css/materialize.min.css}" />
<link rel="stylesheet" href="{url:#css/me.css}" />
<link rel="stylesheet" href="{url:#css/iconfont.css}" />

<style type="text/css">
/**去除绿色下划线 - 开始*/
input::-webkit-input-placeholder {
    color: #7e7e7e;
    text-indent: 5px;
}
input:not([type]),input[type=text],input[type=password],input[type=email],input[type=url],input[type=time],input[type=date],input[type=datetime-local],input[type=tel],input[type=number],input[type=search],textarea.materialize-textarea{background-color:transparent;border:none;border-radius:0;outline:none;height:1.5em;width:100%;font-size:1rem;margin:0;padding:0;box-shadow:none;}
input:not([type]):focus:not([readonly]),input[type=text]:focus:not([readonly]),input[type=password]:focus:not([readonly]),input[type=email]:focus:not([readonly]),input[type=url]:focus:not([readonly]),input[type=time]:focus:not([readonly]),input[type=date]:focus:not([readonly]),input[type=datetime-local]:focus:not([readonly]),input[type=tel]:focus:not([readonly]),input[type=number]:focus:not([readonly]),input[type=search]:focus:not([readonly]),textarea.materialize-textarea:focus:not([readonly]){border-bottom:none;box-shadow:none}
/**去除绿色下划线 - 结束*/
</style>
<!-- JS -->
<script src="{url:#js/jquery-1.11.3.min.js}"></script>
<script src="{url:#js/materialize.min.js}"></script>
<script src="{url:#js/home/register.js}"></script>
<script src="{url:#js/yang_check.js}"></script>
</head>
<body class="q-body">
<!-- TitleBar 开始 -->
<div class="navbar-fixed">
  <nav>
    <div class="nav-wrapper red accent-4 valign-wrapper">
      <ul class="left" id="nav-btn-left" onclick="document.location.href='{url:/mobile/user_center}'">
        <li><a><i class="iconfont">&#xe63c;</i></a></li>
      </ul>
      <span class="title-bar-size center_align">充值中心</span>
      <ul class="right">
        <li><a  class="disabled" style="visibility:hidden"><i class="iconfont">&#xe63c;</i></a></li>
      </ul>
    </div>
  </nav>
</div>
<!-- TitleBar 结束 -->

<div class="container">
	 <div class="q-reg-box">
	    <table>
	    <tr>
			<td class="q-ltitle">充值金额：</td>
			<td><input type="text" name="money" id="money"' style="border:1px solid #ccc;padding:10px; margin-left:-10px;width:100%"/></td>
		</tr>
		<tr>
			<td class="q-ltitle">充值方式：</td>
			<td><select id="payment_id" name="payment_id" style="display:block;border:1px solid #ccc;padding:10px; margin-left:-10px;width:100%"">
                  	{query:name=payment where=id ne 1}
                    <option value="{$item['id']}">{$item['pay_name']}</option>
                    {/query}
                  </select></td>
		</tr>
		
        
	 </table>
	</div>
	<div class="center clearfix" style="margin-right:10px; margin-left:10px;margin-top:60px;">
		<input type="hidden" name="user_id" value="{$mobile_user['id']}"/>
		<a class="waves-effect waves-light btn-large red z-depth-0 login_btn" id="a_recharge" onclick="sub_recharge()">立即充值</a>
	</div>
</div>

<script type="text/javascript">
function sub_recharge()
{
	var money =  $("#money").val();
	var user_id = $("#user_id").val();
	var payment_id = $("#payment_id").val();
	
	if( isNaN(money) || money == '' || money <= 0 )
	{
		//alert('金额必须为数字且必须大于0');
		yang_alert('金额必须为数字且必须大于0');
		return;
	}
	
	$("#a_recharge").removeAttr('onclick');

	$.post('{url:/mobile/recharge_do}',{user_id:user_id,money:money,payment_id:payment_id},function(data){
        if( data['status']=='success' )
	    {
		    //alert('操作成功');
		    //个人中心页面
            document.location.href="{url:/mobile/recharge}";
            
        }
        else
	    {
        	yang_alert(data['msg']);
            //alert(data['msg']);
            document.location.href="{url:/mobile/recharge}";
        }
      },'json');
	
	
}
</script>

</body>
</html>
